package com.dyz.swordFingerOffer;

/**
 * @author: daiyizheng
 * @date: 2021/6/1 21:41
 * @description:
 */
public class Mirror27 {
    public TreeNode Mirror (TreeNode pRoot) {
        // write code here
        if (pRoot==null){
            return null;
        }
        if(pRoot.left!=null){
            Mirror(pRoot.left);
        }
        if(pRoot.right!=null){
            Mirror(pRoot.right);
        }
        TreeNode temp = pRoot.right;
        pRoot.right = pRoot.left;
        pRoot.left = temp;

        return pRoot;
    }
}
